package com.cade.agriculturemall.view.classify;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;

import com.cade.agriculturemall.R;
import com.cade.agriculturemall.base.FWViewHolder;
import com.cade.agriculturemall.model.ClassifyEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Lobby on 2017/11/20.
 */

public class ClassifyAdapter extends RecyclerView.Adapter<FWViewHolder> {
    private TextView mTvItem;

    private List<ClassifyEntity> mEntityList = new ArrayList<>();

    @Override
    public FWViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new FWViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.pc_item_classifity, parent, false));
    }

    @Override
    public void onBindViewHolder(FWViewHolder holder, int position) {
        ClassifyEntity entity = mEntityList.get(position);
        mTvItem = holder.findViewById(R.id.classify_item_textView);
        mTvItem.setText(entity.getValue());
    }

    @Override
    public int getItemCount() {
        return mEntityList.size();
    }
}
